#pragma once
#include <memory>
#include "core.h"
#include "spdlog/spdlog.h"
#include "spdlog/fmt/ostr.h"
namespace Spring
{
	class SPRING_API log
	{
	public:
		log();
		~log();

		static void Init();
		inline static std::shared_ptr<spdlog::logger>& GetCoreLogger() { return s_CoreLogger; }
		inline static std::shared_ptr<spdlog::logger>& GetClientLogger() { return s_ClientLogger; }
	private:
		static std::shared_ptr<spdlog::logger> s_CoreLogger;
		static std::shared_ptr<spdlog::logger> s_ClientLogger;
		
	}; 
}

// core log macros
#define SP_CORE_ERROR(...) ::Spring::log::GetCoreLogger()->error(__VA_ARGS__)
#define SP_CORE_WARN(...)  ::Spring::log::GetCoreLogger()->warn(__VA_ARGS__)
#define SP_CORE_INFO(...)  ::Spring::log::GetCoreLogger()->info(__VA_ARGS__)
#define SP_CORE_TRACE(...) ::Spring::log::GetCoreLogger()->trace(__VA_ARGS__)
#define SP_CORE_FATAL(...) ::Spring::log::GetCoreLogger()->fatal(__VA_ARGS__)
//#define SP_CORE_ASSERT(...) ::Spring::log::GetCoreLogger()->assert(__VA_ARGS__)

// client log macros

#define SP_ERROR(...) ::Spring::log::GetCoreLogger()->error(__VA_ARGS__)
#define SP_WARN(...)  ::Spring::log::GetCoreLogger()->warn(__VA_ARGS__)
#define SP_INFO(...)  ::Spring::log::GetCoreLogger()->info(__VA_ARGS__)
#define SP_TRACE(...) ::Spring::log::GetCoreLogger()->trace(__VA_ARGS__)
#define SP_FATAL(...) ::Spring::log::GetCoreLogger()->fatal(__VA_ARGS__)
